using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using BT.Kinect;
using BTGame.UI;

namespace BT
{

    public class BTGame : Microsoft.Xna.Framework.Game
    {

        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        private KinectInput kinectInput;
       /* Button button;
        Bar x;*/ // Tamer Test
        SwapHand x;
        SpriteFont f;
        public bool Paused
        {
            get { return !kinectInput.SensorFound || !kinectInput.PlayerFound; }
        }

        public BTGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            kinectInput = new KinectInput(this);
            kinectInput.UpdateOrder = 2;
            x = new SwapHand(this);
            x.UpdateOrder = 1;
           /* button = new Button(this,new Vector2(400,30));
            x = new Bar(this,100,20,30,300,30);*/ // Tamer Test  
        }

        protected override void Initialize()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Services.AddService(typeof(SpriteBatch), spriteBatch);
            Services.AddService(typeof(KinectInput), kinectInput);

            base.Initialize();
        }

        protected override void LoadContent()
        {
            f = Content.Load<SpriteFont>("Segoe16");
        }

        protected override void UnloadContent()
        {

        }

        protected override void Update(GameTime gameTime)
        {
          //  x.Update(gameTime);
            base.Update(gameTime);
            
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            /*spriteBatch.Begin();
            spriteBatch.DrawString(f,x.flagy,
                  new Vector2(10, 10), Color.White);

            spriteBatch.End();*/
            base.Draw(gameTime);
        }

        public static void Main(string[] args)
        {
            using (BTGame game = new BTGame())
            {
                game.Run();
            }
        }

    }
}
